﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
using Dcms.Common;
public partial class guestbookcontrol : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        StringBuilder EmailSb = new StringBuilder();
        EmailSb.Append("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">");
        EmailSb.Append("<html xmlns=\"http://www.w3.org/1999/xhtml\">");
        EmailSb.Append("<head>");
        EmailSb.Append("<title>在线订购</title>");
        EmailSb.Append("<style type=\"text/css\">");
        EmailSb.Append(".mybordertable{ margin-top:15px; font-size:11px;}");
        EmailSb.Append(".mybordertable td{ padding:5px; background:#ffffff;}");
        EmailSb.Append(".table_head td{text-align:center; background-color:#eee; font-weight:bold;}");
        EmailSb.Append(".TableleftTd{ font-weight:bold; text-align:right; color:#656565;}");
        EmailSb.Append("</style>");
        EmailSb.Append("</head>");
        EmailSb.Append("<body>");
        EmailSb.Append("<table class=\"mybordertable\" style=\"width: 580px\" cellspacing=\"1\" cellpadding=\"0\" bgcolor=\"#cccccc\" border=\"0\">");
        EmailSb.Append("<tr>");
        EmailSb.Append("<td colspan=\"2\"><strong>在线订购</strong></td>");
        EmailSb.Append("</tr>");
        EmailSb.Append("<tr>");
        EmailSb.Append("<td class=\"TableleftTd\" style=\"width: 105px\">产品名称：</td>");
        EmailSb.Append("<td>"+this.Title.Text+"</td>");
        EmailSb.Append("</tr>");

        EmailSb.Append("<tr>");
        EmailSb.Append("<td class=\"TableleftTd\" style=\"width: 105px\">客户的姓名：</td>");
        EmailSb.Append("<td>"+this.UserName.Text+"</td>");
        EmailSb.Append("</tr>");

        EmailSb.Append("<tr>");
        EmailSb.Append("<td class=\"TableleftTd\" style=\"width: 105px\">客户的电话：</td>");
        EmailSb.Append("<td>"+this.UserTel.Text+"</td>");
        EmailSb.Append("</tr>");

        EmailSb.Append("<tr>");
        EmailSb.Append("<td class=\"TableleftTd\" style=\"width: 105px\">客户的QQ：</td>");
        EmailSb.Append("<td>"+this.UserIM.Text+"</td>");
        EmailSb.Append("</tr>");

        EmailSb.Append("<tr>");
        EmailSb.Append("<td class=\"TableleftTd\" style=\"width: 105px\">客户的邮箱：</td>");
        EmailSb.Append("<td>"+this.UserEmail.Text+"</td>");
        EmailSb.Append("</tr>");

        EmailSb.Append("<tr>");
        EmailSb.Append("<td class=\"TableleftTd\" style=\"width: 105px\">备注：</td>");
        EmailSb.Append("<td>"+this.Content.Text+"</td>");
        EmailSb.Append("</tr>");

        EmailSb.Append("</table>");
        EmailSb.Append("</body>");
        EmailSb.Append("</html>");
        bool IsSend = false;
        IsSend =CEmail.SendSMTPEMail("xuhuigd@hotmail.com", "ligui8087@163.com","客户","在线订购", EmailSb.ToString(), "smtp.163.com", false, 25, "ligui8087","ligui001");
        if (IsSend)
        {
            Jscript.AlertAndBack("在线订购成功");
        }
        else
        {
            Jscript.Alert("在线订购失败，请重试");
        }
    }
}
